import request from '@/api/request'
const {user, auth} = request.config

// 获取角色列表
export function getRoleList(params) {
  return request.get(user + '/management/role/queryAll', params)
}

// 获取单个角色信息
export function getRoleInfo(params) {
  return request.get(user + '/management/role/query', params)
}

// 添加角色
export function addRole(params) {
  return request.post(user + '/management/role/add', params)
}

// 删除角色
export function deleteRole(params) {
  return request.post(user + '/management/role/delete', params)
}

// 更新角色信息
export function updateRole(params) {
  return request.post(user + '/management/role/update', params)
}

// // 更新角色信息（含权限相关信息）
// export function updateRoledetail(params) {
//   return request.post(user + '/management/role/updateRoleInfo', params)
// }

// 获取角色权限信息
export function getRolePermission(params) {
  return request.get(user + '/management/admin/queryResourceByAdminId', params)
}

// 更新角色权限信息
export function updateRolePermission(params) {
  return request.post(user + '/management/roleResource/save', params)
}
//查询角色与权限关联关系基本信息
export function getRoleResource(params) {
  return request.get(user + '/management/roleResource/queryInfo', params)
}


// 回显编辑数据
export function queryResource(params) {
  return request.get(user + '/management/role/queryResource', params)
}